<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>属性选择器 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../CSS/font.html" />
    
    
    <link rel="prev" href="../CSS/伪对象选择器.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.9"
        data-chapter-title="属性选择器"
        data-filepath="CSS/属性选择器.md"
        data-basepath=".."
        data-revision="Fri Sep 01 2017 14:19:43 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="html/HTML.html">
            
                
                    <a href="../html/HTML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        html
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="html/html标签.html">
            
                
                    <a href="../html/html标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        hmtl标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="html/table.html">
            
                
                    <a href="../html/table.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        table
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="html/forms.html">
            
                
                    <a href="../html/forms.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        form
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="html/type.html">
            
                
                    <a href="../html/type.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        type
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="html/实体字符.html">
            
                
                    <a href="../html/实体字符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        实体字符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="html/图像.html">
            
                
                    <a href="../html/图像.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        图像
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="html/icon.iframe.html">
            
                
                    <a href="../html/icon.iframe.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        icon iiframe base
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="html/H5的语义化标签.html">
            
                
                    <a href="../html/H5的语义化标签.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        H5的语义化标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="html/图片的热区域.html">
            
                
                    <a href="../html/图片的热区域.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        图片热区
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="html/锚点.html">
            
                
                    <a href="../html/锚点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        锚点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="html/video.html">
            
                
                    <a href="../html/video.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.11.</b>
                        
                        video
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="html/audio.html">
            
                
                    <a href="../html/audio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.12.</b>
                        
                        audio
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="CSS/css.html">
            
                
                    <a href="../CSS/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="CSS/CSS选择器.html">
            
                
                    <a href="../CSS/CSS选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        css选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="CSS/关系选择器.html">
            
                
                    <a href="../CSS/关系选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="CSS/群组选择器.html">
            
                
                    <a href="../CSS/群组选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        群组选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="CSS/通配选择器.html">
            
                
                    <a href="../CSS/通配选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        通配选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="CSS/元素选择器.html">
            
                
                    <a href="../CSS/元素选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="CSS/元素样式.html">
            
                
                    <a href="../CSS/元素样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        元素样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="CSS/伪类选择器.html">
            
                
                    <a href="../CSS/伪类选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="CSS/伪对象选择器.html">
            
                
                    <a href="../CSS/伪对象选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        伪对象选择器
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.9" data-path="CSS/属性选择器.html">
            
                
                    <a href="../CSS/属性选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="CSS/font.html">
            
                
                    <a href="../CSS/font.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="CSS/嵌入字体.html">
            
                
                    <a href="../CSS/嵌入字体.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        嵌入字体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="CSS/边框样式.html">
            
                
                    <a href="../CSS/边框样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        边框样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="CSS/内边距.html">
            
                
                    <a href="../CSS/内边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        内边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.14" data-path="CSS/外边距.html">
            
                
                    <a href="../CSS/外边距.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.14.</b>
                        
                        外边距
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.15" data-path="CSS/圆角效果.html">
            
                
                    <a href="../CSS/圆角效果.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.15.</b>
                        
                        圆角效果
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.16" data-path="CSS/透明度.html">
            
                
                    <a href="../CSS/透明度.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.16.</b>
                        
                        透明度
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.17" data-path="CSS/段落控制.html">
            
                
                    <a href="../CSS/段落控制.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.17.</b>
                        
                        段落控制
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.18" data-path="CSS/三角形.html">
            
                
                    <a href="../CSS/三角形.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.18.</b>
                        
                        三角形
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.19" data-path="dingwei/绝对定位.html">
            
                
                    <a href="../dingwei/绝对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.19.</b>
                        
                        绝对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.20" data-path="dingwei/相对定位.html">
            
                
                    <a href="../dingwei/相对定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.20.</b>
                        
                        相对定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.21" data-path="dingwei/固定定位.html">
            
                
                    <a href="../dingwei/固定定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.21.</b>
                        
                        固定定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.22" data-path="CSS/mediatype.html">
            
                
                    <a href="../CSS/mediatype.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.22.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h2 id="&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;">&#x5C5E;&#x6027;&#x9009;&#x62E9;&#x5668;</h2>
<h4 id="eatt">E[att]</h4>
<blockquote>
<p>&#x610F;&#x601D;&#x662F;E&#x5143;&#x7D20;&#x7684;att&#x5C5E;&#x6027;&#x90FD;&#x5168;&#x90E8;&#x9009;&#x62E9;&#xFF0C;&#x7136;&#x540E;&#x6539;&#x6210;srules&#x503C;<br>&#x4F46;&#x662F;att&#x4E00;&#x5B9A;&#x8981;&#x662F;&#x5B8C;&#x5168;&#x4E00;&#x6837;&#x7684;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;&#x3002;  </p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
img[alt] {
    margin: 10px;
}
&lt;/style&gt;

&lt;img src=&quot;&#x56FE;&#x7247;url&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;&#x56FE;&#x7247;url&quot; /&gt;
</code></pre>
<h4 id="eattval">E[att=&quot;val&quot;]</h4>
<blockquote>
<p>&#x9009;&#x62E9;E&#x5143;&#x7D20;&#x7684;att&#x5C5E;&#x6027;&#x4E2D;&#x5177;&#x6709;val&#x503C;&#x7684;&#xFF0C;&#x7136;&#x540E;&#x5168;&#x90E8;&#x6539;&#x6210;srules&#x5C5E;&#x6027;&#x3002;<br>&#x5B8C;&#x5168;&#x5339;&#x914D;&#x7279;&#x5B9A;&#x7684;&#x5C5E;&#x6027;&#x548C;&#x5C5E;&#x6027;&#x7684;&#x503C;<br>&#x4E0B;&#x9762;&#x4F1A;&#x5199;&#x51FA;&#x6539;&#x53D8;text&#x7684;&#x8FB9;&#x6846;&#x5927;&#x5C0F;&#x548C;&#x989C;&#x8272;&#x3002;  </p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
input[type=&quot;text&quot;] {
    border: 2px solid #000;
}
&lt;/style&gt;

&lt;input type=&quot;text&quot; /&gt;
&lt;input type=&quot;submit&quot; /&gt;
</code></pre>
<h4 id="eattval">E[att^=&quot;val&quot;]</h4>
<blockquote>
<p>&#x8FD9;&#x4E2A;&#x662F;&#x9009;&#x62E9;att&#x5C5E;&#x6027;&#x5177;&#x6709;&#x5F00;&#x5934;&#x4F4D;val&#x503C;&#x7684;&#x8FDB;&#x884C;&#x53D8;&#x5316;<br>&#x4E0B;&#x9762;&#x7684;&#x610F;&#x601D;&#x662F;&#x6539;&#x53D8;div&#x4E2D;class&#x7684;&#x503C;&#x4E3A;a&#x5F00;&#x5934;&#x7684;div</p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
div[class^=&quot;a&quot;] {
    border: 2px solid #000;
}
&lt;/style&gt;

&lt;div class=&quot;abc&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;acb&quot;&gt;2&lt;/div&gt;
&lt;div class=&quot;bac&quot;&gt;3&lt;/div&gt;
</code></pre>
<h4 id="eattval">E[att$=&quot;val&quot;]</h4>
<blockquote>
<p>&#x9009;&#x62E9;att&#x5C5E;&#x6027;&#x5177;&#x6709;val&#x7ED3;&#x5C3E;&#x7684;&#x503C;&#x8FDB;&#x884C;&#x53D8;&#x5316;  </p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
div[class$=&quot;c&quot;] {
    border: 2px solid #000;
}
&lt;/style&gt;

&lt;div class=&quot;abc&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;acb&quot;&gt;2&lt;/div&gt;
&lt;div class=&quot;bac&quot;&gt;3&lt;/div&gt;
</code></pre>
<h4 id="eattval">E[att*=&quot;val&quot;]</h4>
<blockquote>
<p>&#x5339;&#x914D;&#x5177;&#x6709;&#x7279;&#x5B9A;&#x5B57;&#x7B26;&#x7684;&#x5C5E;&#x6027;&#x503C;(&#x53EA;&#x8981;&#x5305;&#x542B;&#x5C31;&#x884C;&#xFF0C;&#x4E0D;&#x4E00;&#x5B9A;&#x8981;&#x5168;&#x5339;&#x914D;)<br>&#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x610F;&#x601D;&#x662F;&#x53EA;&#x8981;class&#x4E2D;&#x7684;&#x503C;&#x6709;b&#x5B57;&#x6BCD;&#x5C31;&#x5168;&#x90E8;&#x8981;&#x88AB;&#x63A7;&#x5236;</p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
div[class*=&quot;b&quot;] {
    border: 2px solid #000;
}
&lt;/style&gt;

&lt;div class=&quot;abc&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;acb&quot;&gt;2&lt;/div&gt;
&lt;div class=&quot;bac&quot;&gt;3&lt;/div&gt;
</code></pre>
<h4 id="eattval">E[att|=&quot;val&quot;]</h4>
<blockquote>
<p>&#x9009;&#x62E9;att&#x5C5E;&#x6027;&#x5E76;&#x4E14;&#x6709;-val&#x503C;&#x7684;&#x5143;&#x7D20;&#x6765;&#x8FDB;&#x884C;&#x53D8;&#x5316;<br>&#x5339;&#x914D;&#x4E24;&#x79CD;&#x60C5;&#x51B5;<br>1.&#x6709;&#x4E14;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x4E14;&#x7B26;&#x5408;&#x7279;&#x5B9A;&#x7684;&#x503C;<br>2.&#x5E26;&#x6709;&#x7279;&#x5B9A;&#x503C;&#x4E14;&#x540E;&#x9762;&#x8DDF;&#x4E0A;&quot;-&quot;  </p>
</blockquote>
<pre><code class="lang-css">&lt;style&gt;
div[class|=&quot;a&quot;] {
    border: 2px solid #000;
}
&lt;/style&gt;

&lt;div class=&quot;a-test&quot;&gt;1&lt;/div&gt;
&lt;div class=&quot;b-test&quot;&gt;2&lt;/div&gt;
&lt;div class=&quot;c-test&quot;&gt;3&lt;/div&gt;
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../CSS/伪对象选择器.html" class="navigation navigation-prev " aria-label="Previous page: 伪对象选择器"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../CSS/font.html" class="navigation navigation-next " aria-label="Next page: 字体"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
